var city_with_biggest_temp_diff = []
$.ajax({
    url: 'get_city_with_biggest_temp_diff',
    type: 'get',
    asyn: false,
    success: function (res) {
        res = eval('('+res+')')
        Object.values(res).forEach(val => {
            city_with_biggest_temp_diff.push({
                name: val.area,
                value: val.temp_diff
            })
        })
    }
})
console.log(city_with_biggest_temp_diff)

var t_d = {
    value: city_with_biggest_temp_diff,
    image: ''
}
var img1 = new Image();
img1.src = t_d.image


const get_word_cloud_biggest_temp_diff_option = function () {
    return {
        title: {
            text: '全国温差前10城市',
            left: 'center'
        },
        tooltip: {
            show: false
        },
        color: 'black',
        series: [{
            type: 'wordCloud',
            gridSize: 10,
            sizeRange: [1, 30],
            // rotationRange: [-45, 0, 45, 90],
            maskImage: img1,
            textStyle: {
                normal: {
                    color: 'black'
                }
            },
            // left: '10%',
            // top: 'bottom',
            width: '100%',
            height: '100%',

            data: t_d.value
        }]


    }
};

